#pragma once
#include<iostream>
#include<assert.h>
using namespace std;
class Date 
{
public:
	Date(int year, int month, int day);
	Date(const Date& d);

	bool operator<(const Date& d);
	bool operator<=(const Date& d);
	bool operator>(const Date& d);
	bool operator>=(const Date& d);
	bool operator==(const Date& d);
	bool operator!=(const Date& d);
	Date& operator +=(int day);
	Date operator+(int day);
	Date& operator -= (int day);
	Date operator -(int day);
	//++d
	Date& operator++();
	//d++
	Date operator++(int);
	//--d
	Date& operator--();
	//d--
	Date operator--(int);
	int operator-(const Date& d);
	int GetMonthDay(int year, int month)
	{
		assert(month >0 && month<13);
		int monthdays[13] = { 0,31,28,31,30,31,30,31,31,30,31,30,31 };
		if (month == 2)
		{
			if ((year % 4 == 0 && year % 100 != 0) || year % 400 == 0)
			{
				return 29;
			}
		}
		return monthdays[month];
		
	}
	void print()
	{
		cout << _year << "-" << _month << "-" << _day << endl;
	}
	
private:
	int _year;
	int _month;
	int _day;
};